﻿Imports System.Data.SqlClient
Public Class SystemRole

    Public Shared Sub getPosition(ByVal groupId As String, cbo As ComboBox, ByRef salary As String, ByRef posId As String)
        cbo.DisplayMember = "RoleName"
        cbo.ValueMember = "RoleId"

        Dim dt = CmdText.ExecuteDataTable("SELECT * FROM system.Role WHERE groupId=" + groupId.ToString + " and Active=1")


        cbo.DataSource = dt
        If (dt.Rows.Count >= 1) Then

            salary = dt.Rows(0)("Salary")
            posId = dt.Rows(0)("RoleId")

        End If
    End Sub
    Public Shared Sub getSalary(ByRef posName As String, ByRef salary As String, ByRef Posid As String)

        Dim dt = CmdText.ExecuteDataTable("SELECT * FROM system.Role WHERE RoleName like N'" + posName.ToString + "' and Active=1 ")

        If (dt.Rows.Count = 1) Then

            salary = dt.Rows(0)("Salary")
            Posid = dt.Rows(0)("RoleId")


        End If
    End Sub
End Class
